All Questions
9 questions
1vote
1answer
349views
Bash Script to create a file for each unique permission in a listing/find command and printing each directory/file path instance of that permission
I'm trying to create a bash script that will be able to perform a find command to get the permissions and full path of every file/directory in a directory tree and create a file for each unique ...
2votes
0answers
2kviews
"permission denied" when appending with echo, but working with vi [duplicate]
I have a file -rw-rw-r-- 1 root mygroup 0 Sep 10 14:54 /etc/nginx/mygroup.txt The access rights are set so that the group mygroup has read and write permissions for the file. Writing the file with a ...
1vote
1answer
3kviews
Script to find files less permissive than 750?
I need to write a STIG rule that will check for all files within a user's home directory, and result in a 1 if any are found to be less permissive than 750. This is what i have made so far. egrep ":[...
1vote
1answer
3kviews
How to validate basic file information [duplicate]
I am trying to write a Bash script that takes the name of a file or directory as an argument and reports if the file is a directory, regular file or other. The script should also report if the user ...
0votes
0answers
33views
File attributes, permissions issue
I have a shell script that runs on 2 machine by a job scheduler. The script generates some text file when it is executed. On one system, the text file generated has the permission: -rw-r--r-- 1 ...
1vote
2answers
518views
shell or perl script to check group have read privileges
ls -l drwx------ 8 ws web 1024 Apr 29 2013 abc drwxr-xr-x 8 ws web 1024 Oct 19 2011 def I need some script to find directories like abc which doesn't have read/execute permissions for ...
31votes
3answers
16kviews
How to non-invasively test for write access to a file?
In a shell script, how do I easily and non-invasively test for write access to a file without actually attempting to modify the file? I could parse the output of stat, but that seems really complex, ...
-1votes
1answer
31views
A command showing if I have the right to perform writing?
I'm searching for a command which only says if the current user has r-rights (read) on the file passed as a parameter. This command could be something like haveIRights -x <file> and it has to ...
2votes
1answer
11kviews
File with 777 permission can't be read
I'm fairly new to Unix and I have written a script: SERVER="/usr/local/abc/.../somefile.txt" OPTION="$1" if [ x$OPTION = "xtitle" ] then grep $OPTION $SERVER exit fi As far as I ...